home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / mail / db.1.85.tar.gz / db.1.85.tar / db.1.85 / PORT / README < prev   
Text File  |  1994-06-20  |  5KB  |  132 lines

  1. #    @(#)README    8.6 (Berkeley) 6/20/94
  2.  
  3. This is the area for building the libdb library.  There are a number
  4. of porting directories, for various architecture/OS combinations.  Pick
  5. the one that's closest to yours and try "make".  For the rest of this
  6. file, I'll use "MACH" as a fake architecture/OS name.
  7.  
  8. To PORT to a new system, create the following subdirectories and
  9. symbolic links.
  10.  
  11.     mkdir MACH        (for example: mkdir sunos.4.0)
  12.     cd MACH
  13.     cp ../Makefile .
  14.     chmod 664 Makefile
  15.     ln -s ../clib .
  16.     mkdir include
  17.     ln -s include sys
  18.     cd include
  19.     ln -s ../../include/*.h .
  20.     rm compat.h
  21.     cp ../../include/compat.h .
  22.     chmod 664 compat.h
  23.     cd ..
  24.  
  25. The basic idea is that you now have a local area that you can modify.
  26. In particular, you have local copies of the Makefile and the include
  27. file compat.h.  Read through the Makefile and compat.h and make whatever
  28. changes are appropriate to your system.  If there's an architecture
  29. that's close to yours, you probably should diff the Makefile and
  30. compat.h in that tree against the standard ones and see what changes
  31. were necessary, as they're probably necessary for you as well.  Then,
  32. enter "make" and see what happens!
  33.  
  34. There are several subroutines that are found in POSIX 1003.2, ANSI
  35. C, or 4.4BSD that you may not have.  Once you get libdb.a to compile,
  36. go through the list of undefined routines and add entries to the MISC
  37. line in the Makefile as necessary.
  38.  
  39. If you have to add some functions that are missing (and which aren't
  40. in the PORT/clib directory), please don't add them in the PORT/clib
  41. directory.  Add them in a MACH/local directory, and add lines of the
  42. form:
  43.  
  44.     function.o: local/function.o
  45.         ${CL} -Ilocal local/function.o
  46.  
  47. to your local Makefile.
  48.  
  49. Hopefully, over time, we'll develop a set of system directories that
  50. are known to work.  If you send me the changes that were necessary to
  51. make your system work, this will happen much more quickly.
  52.  
  53. In some of the system directories, you'll see a file named OTHER_PATCHES.
  54. This is a set of patches which you'll have to make from the top-level db
  55. directory to get libdb.a to run on this system:
  56.  
  57.     cd ..
  58.     patch < PORT/MACH/OTHER_PATCHES
  59.  
  60. If patch prompts you for the name of the file to modify (some versions
  61. of patch don't figure it out on their own) use the file name which patch
  62. displays.
  63.  
  64. Some knobs you may have to turn:
  65.  
  66. In include/db.h:
  67.     Before attempting to build libdb, you should look through the
  68.     db.h file, and adjust it as necessary for your system.  The
  69.     only adjustments that you should need to make are for the
  70.     fixed sized typedef's at the top of the file.  Make sure they're
  71.     right for your system.
  72.  
  73. In include/compat.h:
  74.     Before attempting to build libdb, you should look through the
  75.     compat.h file, and adjust it as necessary for your system.
  76.     It's possible to use the #ifndef construct to figure out if a
  77.     #ifdef has been set, but C provides no similar method to figure
  78.     out if a typedef has been done.  Your compile errors should
  79.     give you a good indication of which ones you need.
  80.  
  81. You may see warning messages about illegal pointer combinations.  You may
  82. also see lots of warning messages about #define's being redefined.  These
  83. can mostly be ignored.  I usually ignore warning messages until something
  84. doesn't work.  Some systems produce thousands of lines of useless warnings,
  85. bless their little hearts.
  86.  
  87. The other parts of the PORT directory are as follows:
  88.  
  89.     The directory PORT/clib is a set of functions that the 4.4BSD
  90.     C library had and which your system may not have.  They are
  91.     added to the MISC line of the Makefile if they aren't defined
  92.     when you try and load libdb.a.
  93.     
  94.     The directory PORT/include is header files that the 4.4BSD
  95.     system had which your system may not have.  There is also
  96.     one really important extra one, named compat.h, which is a
  97.     set of compatibility work-arounds that you'll almost certainly
  98.     have to copy and modify for a new system.
  99.  
  100.     The symbolic link PORT/sys points to the PORT/include directory
  101.     so that includes of the form <sys/include.h> work.
  102.  
  103. Some of the more common portability problems:
  104.  
  105.     If you don't have:
  106.  
  107.         memmove(3):    add memmove.o
  108.         mkstemp(3):    add mktemp.o
  109.  
  110.             ... to the MISC line in the Makefile.
  111.  
  112.     If you don't have snprintf/vsnprintf(3), add snprintf.o to the
  113.     MISC line in the Makefile.  This workaround depends on your
  114.     system having vsprintf(3) -- if you don't, there's no workaround
  115.     other than changing the source code to not use the snprintf calls.
  116.     If you have to make that change, check to see if your vsprintf
  117.     returns a length or a char *; if it's the latter, make sure you
  118.     set VSPRINTF_CHARSTAR in the MACH/include/compat.h file.
  119.  
  120. Installing the DB library:
  121.  
  122.     The Makefile builds a C library named libdb.a.  This file needs
  123.     to be installed in a place where the loader will automatically
  124.     look for it (or, if you're building it for a single project,
  125.     wherever that project's Makefile loads it from).
  126.  
  127.     In addition, the header file PORT/include/db.h must be copied to
  128.     a directory (often /usr/include/) where programs that use the
  129.     db package can include it in their source.  (If you intend to use
  130.     the ndbm interface to libdb, you'll need to copy the header file
  131.     PORT/include/ndbm.h as well.)
  132.